package core.util;

import java.lang.ref.Reference;
import java.util.Iterator;
public final class ReferenceIteratorWrapper <T> implements Iterator <T> {
	private Iterator <? extends Reference <T> > iterator_;
	public ReferenceIteratorWrapper(Iterator<? extends Reference<T>> iterator) {
		iterator_ = iterator;
	}
	public boolean hasNext() {
		return iterator_.hasNext();
	}
	public T next() {
	    return (T)iterator_.next();
	}
	public T nextNotNull() {
		while (iterator_.hasNext()) {
			T t = (T)iterator_.next();
			if (t != null) {
				return t;
			}
		}
		return null;
	}
	public void remove() {
		iterator_.remove();
	}

  
}

